<!-- HTML header for doxygen 1.8.5-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.5"/>
<title>Introduction</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0" width="100%">
    <tbody>
        <tr>
            <td id="projectlogo" style="text-align:left; padding-left: 0.5em;">
                <img alt="Logo" width="100" height="50" src="fat32lib.png" />
            </td>
        </tr>
        <tr style="background-image:url('tab_b.png'); height:30px">
            <td>
                <table cellspacing="0" cellpadding="0">
                    <tr>
                        <td style="padding-left: 0.5em;">
                            <div id="projectbrief">File System Stack for Embedded Devices</div>
                        </td>
                        <td style="vertical-align:middle">
                            <div>&nbsp;        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
</div>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
    </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.5 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('main.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Macros</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Pages</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">Introduction </div>  </div>
</div><!--header-->
<div style="margin-left:20px; margin-right:20px">
<table width="100%">
    <tr>
        <td style="height:20px"></td>
    </tr>
    <tr>
        <td style="text-align: justify; margin: 10px">
            <span>
                &nbsp;&nbsp;&nbsp;&nbsp;
                    Fat32lib is a portable FAT12/16/32 file system stack for embedded devices. 
                All components, except for the Hardware Abstraction Layer (HAL) are written in 
                portable ANSI C89 code to any platform with a C89 compiler. It is intended for 
                embedded devices where memory and processing power are scarce resources. It has a 
                lot features you will find on libraries designed for largee devices (including 
                asynchronous/non-blocking IO, unbuffered/buffered IO, drive management, and more.) 
                It requires about 2 KBs of memory for basic operation (with long filenames disabled) 
                and it’s optimized for flash devices. The included SD Card driver accesses an SD Card 
                device through the SPI interface and can use the WRITE_MULTIPLE_BLOCKS command of the 
                SD Card to write large amounts of data from buffers as small as 512 bytes. The entire stack, 
                including the SD Card driver, is designed to be portable. Only the HAL library (which consists 
                mostly of macros for accessing the SPI and DMA modules) needs to be re-written for the 
                target platform. It can even be ported to devices without an SPI or DMA module by implementing 
                this functionality in software. Below is a diagram of all the layers in the stack and below 
                it is a description of each layer. All the layers in are interchangeable (you can even add 
                3rd party file systems provided you implement the interface required by smlib) and the Volume 
                Manager (smlib) layer is optional and can be excluded to save space. You can also exclude any 
                features not required by your application at compile-time to save space.
            </span>
        </td>
    </tr>
    <tr>
        <td style="height:20px"></td>
    </tr>
    <tr>
        <td align="center">
            <img alt="Fat32Lib Layers" src="layers.jpg" />
        </td>
    </tr>
    <tr>
        <td style="height:20px"></td>
    </tr>
    <tr>
        <td style="text-align: left; text-decoration: underline; font-weight: 700; margin: 10px">
            <span>Application</span>
        </td>
    </tr>
    <tr>
        <td style="text-align: justify; margin: 10px">
            <span>
                Your application communicates with the file system through the Volume Manager library or, 
                optionally, through the File System library.
            </span>
        </td>
    </tr>
    <tr>
        <td style="height:20px"></td>
    </tr>
    <tr>
        <td style="text-align: left; text-decoration: underline; font-weight: 700; margin: 10px">
            <span>Volume Manager (smlib)</span>
        </td>
    </tr>
    <tr>
        <td style="text-align: justify; margin: 10px">
            <span>
                The Volume Manager unifies several file system libraries and volumes. 
                Its API is almost identically to the one of the file system library except 
                that since it manages volumes for you you don’t need to provide a volume handle 
                to each function. Drives are mounted using a drive letter or label and the Volume 
                Manager decides which file system or volume should handle the request based on 
                the path. It can also be configured to monitor a removable device and mount the 
                volume automatically when the device is inserted and it provides notification of 
                such events to your application via callback functions. Additionally, it can be 
                configured at compile-time to support file locks. When this feature is enabled a 
                file can be opened an unlimited number of times for read access but only once for 
                write access.  The API for the volume manager is declared in the sm.h header file.
            </span>
        </td>
    </tr>
    <tr>
        <td style="height:20px"></td>
    </tr>
    <tr>
        <td style="text-align: left; text-decoration: underline; font-weight: 700;">
            <span>File System (fat32lib)</span>
        </td>
    </tr>
    <tr>
        <td style="text-align: justify;">
            <span>
                The File System library is the core of the stack, it handles all IO functions. 
                It supports FAT12, FAT16, and FAT32 volumes. Its features include multiple concurrent 
                asynchronous (non-blocking) IO requests, unbuffered as well as buffered IO (the SD driver 
                requires a 512 bytes DMA buffer for asynchronous IO), stream functions for writing 
                continuously to the device, multi-threading support, and more.
            </span>
        </td>
    </tr>
    <tr>
        <td style="height:20px"></td>
    </tr>
    <tr>
        <td style="text-align: left; text-decoration: underline; font-weight: 700;">
            <span>Device Driver (sdlib)</span>
        </td>
    </tr>
    <tr>
        <td style="text-align: justify;">
            <span>
                The driver handles low-level communication with the device. The library comes with a 
                portable SD Card driver but you can develop drivers for any IO device. A driver can be 
                as simple as a write_sector, read_sector, and get_sector_count/size functions for the basic 
                read write functionality. More advanced features require more complex drivers. The included 
                SD Card driver is designed to be portable. It uses the HAL library to access device-specific 
                features such as SPI module, DMA, and IO ports.
            </span>
        </td>
    </tr>
    <tr>
        <td style="height:20px"></td>
    </tr>
    <tr>
        <td style="text-align: left; text-decoration: underline; font-weight: 700; margin: 10px">
            <span>Hardware Abstraction Layer (dspic_hal)</span>
        </td>
    </tr>
    <tr>
        <td style="text-align: justify; margin: 10px">
            <span>
                The Hardware Abstraction Layer (HAL) provides access to device specific features such 
                as SPI and DMA modules, and IO ports. It is the only component that needs to be written 
                specifically for target platform. It consists mostly of macros for accessing the device-specific 
                modules.
            </span>
        </td>
    </tr>
    <tr>
        <td style="height:20px"></td>
    </tr>
    <tr>
        <td style="text-align: left; text-decoration: underline; font-weight: 700; margin: 10px">
            <span>Device</span>
        </td>
    </tr>
    <tr>
        <td style="text-align: justify; margin: 10px">
            <span>
                This is the physical IO device. It can be any storage device as 
                long as proper drivers are developed.
            </span>
        </td>
    </tr>
    <tr>
        <td style="height:20px"></td>
    </tr>
</table>
</div>
</div><!-- doc-content -->
<!-- HTML footer for doxygen 1.8.5-->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="footer">Copyright &copy; 2013 by <a href="mailto:frodriguez.developer@outlook.com">Fernando Rodriguez</a></li>
  </ul>
</div>
</body>
</html>
